<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="/jquery.js"></script>
    <!-- <script src="ajax.js"></script> -->
</head>

<body>
    <input type="text" placeholder="名字" id="name">
    <input type="number" placeholder="年龄" id="age">
    <input type="text" placeholder="婚姻状况" id="marriage">
    <button id="submit">提交</button>
</body>
<script>
    var lisis = []

    $('#submit').click(function () {
        let name = $('#name').val()
        let age = $('#age').val()
        let marriage = $('#marriage')
        let list = {
            name:name,
            age:age,
            marriage:marriage,
        }
        lisis.push(list)
        save('lisis',lisis)
    })

    function save() {
        localStorage.setItem('lisis', JSON.stringify(lisis))
    }
</script>

</html>